/**
 * 参与活动
 * @param  {object} info [用户信息]
 *  * @param  {number} activeId [用户信息]
 * @param  {function} successCallback [成功回调]
 * @param  {function} errorCallback [错误回调]
 */
function joinActive(info, activeId, successCallback, errorCallback) {
  $.ajax({
    url: 'ajax/join',
    type: 'post',
    async: true,
    data: {
      userId: info.id,
      token: info.token,
      activeId: activeId
    },
    dataType: 'json',
    success: function(data) {
      if (data.returnCode == 0) {
        successCallback(data);
      }
      else {
        errorCallback(data);
      }
    }
  });
}
/**
 * 检查活动资格
 * @param  {object} info [用户信息]
 *  * @param  {number} activeId [用户信息]
 * @param  {function} successCallback [成功回调]
 * @param  {function} errorCallback [错误回调]
 */
function checkActive(info, activeId, successCallback, errorCallback) {
  $.ajax({
    url: 'ajax/check',
    type: 'post',
    async: true,
    data: {
      userId: info.id,
      token: info.token,
      activeId: activeId
    },
    dataType: 'json',
    success: function(data) {
      if (data.returnCode == 0) {
        successCallback(data);
      }
      else {
        errorCallback(data);
      }
    }
  });
}
